# Compiler
CC = gcc

# Compiler flags
CFLAGS = -g -pedantic -std=gnu17 -Wall -Werror -Wextra

# Targets
all: nyush

# Build the nyush executable
nyush: nyush.o shell.o prompt.o
	$(CC) $(CFLAGS) $^ -o $@

# Compile nyush.c
nyush.o: nyush.c shell.h prompt.h
	$(CC) $(CFLAGS) -c $< -o $@

# Compile shell.c
shell.o: shell.c shell.h prompt.h
	$(CC) $(CFLAGS) -c $< -o $@

# Compile prompt.c
prompt.o: prompt.c prompt.h
	$(CC) $(CFLAGS) -c $< -o $@

# Clean the project
clean:
	rm -f *.o nyush
